SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GetQuestionnaireItemsForVersion]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[GetQuestionnaireItemsForVersion]
GO


/***************************************************************************
* Name:				GetQuestionnaireItemsForVersion
* Purpose:			Returns all the questions tied to a questionnaire version
*
*
* PARAMETERS
* Name				Description					
* -------------			-----------------------------------------------------------
* @questionnaireVersionID	id of the QuestionnaireVersion
***************************************************************************/
CREATE PROCEDURE [dbo].[GetQuestionnaireItemsForVersion]

@questionnaireVersionID int

 AS
BEGIN

SELECT [ID], VersionId, ItemName, ItemText, ItemType, ItemOrder, HasSeparator, Indent, ParentName, ParentValue, Required, ValidationMessage, OptionsRefDomain  FROM QuestionnaireItem 
where VersionId = @questionnaireVersionID

END
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


